﻿//  Copyright (c) 2011 Ray Liang (http://www.dotnetage.com)
//  Licensed MIT: http://www.opensource.org/licenses/mit-license.php

using System.Web.Mvc;

namespace DNA.Mvc.Community //DNA.Mvc.Areas.Community
{
    public class CommunityAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Community";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            #region Not now
            //context.MapRoute(
            //                "Community_Group",
            //                "Community/{group}-{id}.html",
            //                new { action = "Group", controller = "Forum", id = "0" },
            //                new { group = "g", id = @"^\d+" }
            //                );

            //context.MapRoute(
            //                "Community_Forum",
            //                "Community/{forum}-{id}-{index}-{size}.html",
            //                new { action = "Threads", controller = "Forum", index = 1, size = 20,total=0 },
            //                new { forum = "f" }
            //                );

            //context.MapRoute(
            //                "Community_Thread",
            //                "Community/{thread}-{id}-{index}-{size}.html",
            //                new { action = "Index", controller = "Thread", index = 1, size = 20,total=0 },
            //                new { thread = "t" }
            //                );
            #endregion

            //context.MapRoute(
            //    "Community_MyForum",
            //    "Community/{website}/{myposts}.html",
            //    new { action = "MyForum", controller = "Forum", website = "home" },
            //    new { myposts = "myposts" } );
            context.MapRoute(
    "Community_sub",
    "Community/{website}-{controller}/{action}/{id}",
    new { id = UrlParameter.Optional }
);
            context.MapRoute(
                "Community_default",
                "Community/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );
        }
    }
}
